// Copyright 2019 JDAI Inc.
// License ()
// Author:  XXXXXXX (), XXXX@jd.com
// Filename:  BrpcServer.h
// Description:
// Created:  11/15/19 15:21:22
// Version:  1.0
// Company:  JDAI
//
//
#ifndef BrpcServer_H_
#define BrpcServer_H_
#include "IHttpServer.h"

#include "bvar/bvar.h"
#include "bthread/bthread.h"
#include "bthread/butex.h"
#include "bthread/unstable.h"

#include "gflags/gflags.h"
#include "butil/logging.h"
#include "butil/time.h"
#include "brpc/channel.h"
#include "brpc/server.h"
#include "brpc/restful.h"

#include "TTSServiceImpl.h"

using brpc::Server;
using brpc::ServerOptions;

class BrpcServer: IHttpServer {
  public:
    BrpcServer();
    virtual ~ BrpcServer();

    int start();
    int stop();
    static bool loadResouce(const string& modelPath);

  private:
    Server* mpHttpServer;
    ServerOptions* mpServerOptions;
    TTSServiceImpl* mpTTSHttpService;
};

#endif
